package view;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.xuegengwang.xuegengwang.MainActivity;
import com.example.xuegengwang.xuegengwang.R;

import common.Constant;

/**
 * Created by Administrator on 2017/5/8.
 */

public class MyToFourFragmentDialog extends Dialog{
    private Context context;

    public MyToFourFragmentDialog(Context context) {
        super(context);
        this.context = context;
    }

    public MyToFourFragmentDialog(Context context, int themeResId) {
        super(context, themeResId);
        this.context = context;
    }

    protected MyToFourFragmentDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        this.context = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.completeinfo_dialog);
        setCanceledOnTouchOutside(true);
        findViewById(R.id.completeinfo_dialog_contentView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        findViewById(R.id.completeinfo_dialog_ima).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(context, MainActivity.class);
                context.startActivity(i);
                Intent intent = new Intent(Constant.ACITION_FOURFRAGMENT);
                context.sendBroadcast(intent);
                dismiss();
            }
        });
    }
}
